//
//  NSArray + Log.m
//  dictionaryTest
//
//  Created by 儒道释 on 15/12/23.
//  Copyright © 2015年 tiantianchedai. All rights reserved.
//

#import "NSArray+Log.h"

@implementation NSArray(log)

-(NSString *)descriptionWithLocale:(id)locale;
{
    if ( self.count == 0 ) {
        return @"空空的数组";
    }
    NSMutableString *returnStr = [NSMutableString string];
    if ([self isKindOfClass:[NSMutableArray class]]) {
        [returnStr appendString:@"[(-可变数组-) \n"];
    }
    else [returnStr appendString:@"[ \n"];
    for (int i = 0; i < self.count ; i++) {
        id obj = [self objectAtIndex:i];
        [returnStr appendFormat:@"      %@,\n",obj];
    }
    [returnStr appendString:@"] "];
         return returnStr;
}

@end

@implementation NSDictionary(log)

-(NSString *)descriptionWithLocale:(id)locale;
{
    if ( self.count == 0 ) {
        return @"空空的字典";
    }
    NSMutableString *returnStr = [NSMutableString string];
    if ([self isKindOfClass:[NSMutableDictionary class]]) {
        [returnStr appendString:@"{(-可变字典-)"];
    }
    else [returnStr appendString:@"{ \n"];
    for (id obj in self) {
        [returnStr appendFormat:@"      %@ = %@;\n",obj,self[obj]];
    }
    [returnStr appendString:@"} "];
    return returnStr;
}
@end